package com.yan.demo.method;
// 无参有返回值
public class MethodDemo3 {
    public static void main(String[] args) {
        int max = getMax();
        System.out.println("最大值为" + max);
    }

    public static int getMax() {
        int[] arr = {5, 12, 90, 18, 77, 76, 45, 28, 59, 72};
        int max = arr[0];
        for (int i = 0; i < arr.length; i++) {
            if(arr[i] > max){
                max = arr[i];
            }
        }
        return max;
    }

}
